<?php
/**
 * Created by PhpStorm.
 * User: chenxiaogang
 * Date: 2017/11/22
 * Time: 17:01
 */

namespace User\Model;


use Common\Model\CommonModel;

class SystemUser extends CommonModel
{
    protected $connection = 'DB_CONFIG2';
    protected $trueTableName = 'system_user';

    /**
     * @use          [得到一个列表in限制的用户信息]
     * @author       chenxiaogang
     * @param $in array
     * @param $need string [需要的字段]
     * @return array
     */
    public function getByIn($in,$need = 'name'){
        $data = $this->field($need)->where([
            'user_status'=>1,
            'id'=>['in',$in]
        ])->getField('id,'.$need,true);
        return $data;
    }

}